home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_07
/
8n07071b
< prev
next >
Wrap
Text File
|
1990-06-17
|
591b
|
34 lines
\end{verbatim}
Stack : (T:Type) -> Type is
uses
Boolean
ops
push : T -> nil
pre
isfull.not
post
isempty.not
done
pop : nil -> T
pre
isempty.not
post
isfull.not
done
isempty : nil -> Boolean
isfull : nil -> Boolean
const
s0 : Stack(T)
eqn # this is a comment
# push and pop are inverse to each other
'pop( 'push( s, x)) iseq (s, x)
'push( 'pop( s)) iseq s
# there is a unique empty stack value
'isempty( s0) iseq TRUE
'isempty( s) => s iseq s0
done